package com.city.itis.domain;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;


/**
 * 站点信息JavaBean值类
 * @author WY
 *
 */
@Entity
@Table(name = "site")
public class Site implements Serializable
{
	private static final long serialVersionUID = 1L;	//系统自动生成的版本序列号
	
	private Integer siteNo=null;	//地点编号
	private Integer categoryNo=null;	//类别编号
	private SiteCategory category=new SiteCategory();	//类别对象
	private String siteName=null;	//地点名称
	private String siteDesc=null;	//简介
	private String address=null;	//地址
	private String city=null;	//城市
	private String contactName=null;	//联系人
	private String tel=null;	//电话
	private String fax=null;	//传真
	private String mobile=null;	//手机
	private String webSite=null;	//网址
	private String email=null;	//邮箱
	private String photoName=null;	//图片(保存DB为图片内容)
	private double lat=0;	//纬度
	private double lng=0;	//经度
	private String showStatus=null;	//是否显示
	private Member member= new Member();	//会员对象
	
	@Id
	@GeneratedValue
	public Integer getSiteNo() {
		return siteNo;
	}
	public void setSiteNo(Integer siteNo) {
		this.siteNo = siteNo;
	}
	
	
	@Transient
	public Integer getCategoryNo() {
		return categoryNo;
	}
	public void setCategoryNo(Integer categoryNo) {
		this.categoryNo = categoryNo;
	}
	/**
	*
	* 只需在多方Site中添加一个SiteCategory同时添加注解@ManyToOne即可（Many代表Site，One代表SiteCategory）
	*/
	@ManyToOne
	@JoinColumn(name="categoryNo") 
	public SiteCategory getCategory() {
		return category;
	}
	public void setCategory(SiteCategory category) {
		this.category = category;
	}
	public String getSiteName() {
		return siteName;
	}
	public void setSiteName(String siteName) {
		this.siteName = siteName;
	}
	public String getSiteDesc() {
		return siteDesc;
	}
	public void setSiteDesc(String siteDesc) {
		this.siteDesc = siteDesc;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getContactName() {
		return contactName;
	}
	public void setContactName(String contactName) {
		this.contactName = contactName;
	}
	public String getTel() {
		return tel;
	}
	public void setTel(String tel) {
		this.tel = tel;
	}
	public String getFax() {
		return fax;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String getWebSite() {
		return webSite;
	}
	public void setWebSite(String webSite) {
		this.webSite = webSite;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getPhotoName() {
		return photoName;
	}
	public void setPhotoName(String photoName) {
		this.photoName = photoName;
	}
	public double getLat() {
		return lat;
	}
	public void setLat(double lat) {
		this.lat = lat;
	}
	public double getLng() {
		return lng;
	}
	public void setLng(double lng) {
		this.lng = lng;
	}
	public String getShowStatus() {
		return showStatus;
	}
	public void setShowStatus(String showStatus) {
		this.showStatus = showStatus;
	}
	@ManyToOne(fetch=FetchType.LAZY,optional=true)
	@JoinColumn(name="memberId") 
	public Member getMember() {
		return member;
	}
	public void setMember(Member member) {
		this.member = member;
	}	
	
   
}
